﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PatternDecorator
{
    class Program
    {
        static void Main(string[] args)
        { 
            RobotDecotator robotA = new RobotDecotator(new RobotA());
            robotA.doMorething();

            Console.ReadKey();
        }
    }

    abstract class Robot  
    {
        public  abstract void  doSomething();
    }

    class RobotA : Robot
    {
        public override void doSomething()
        {
            Console.WriteLine("doSomethingA");
        }

    }

    class RobotDecotator : Robot
    {
        Robot robot = null;
        public RobotDecotator(Robot _robot)
        {
            this.robot = _robot;
        }

         
        public override void doSomething()
        {
            robot.doSomething(); 
        }

        public void doMorething()
        {
            robot.doSomething();
            Console.WriteLine("doOtherThings");
        } 

    }



}
